<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Site extends CI_Controller {

	public function send()
	{
		
		$name = $this->input->post('name');
		$email = $this->input->post('email');
		$message = $this->input->post('message');


		$config = Array(
		    'protocol' => 'smtp',
		    'smtp_host' => 'ssl://smtp.gmail.com',
		    'smtp_port' => 465,
		    'smtp_user' => 'marko.bozovic.etf@gmail.com',
		    'smtp_pass' => 'marko12358',
		    'mailtype'  => 'html', 
		    'charset'   => 'iso-8859-1',
		    'newline'   => "\r\n"
		);

		
		$this->load->library('email',$config);
		$this->email->from($email,$name);
		$this->email->to('marko.bozovic.work@gmail.com');
		$this->email->subject('Test email');
		$this->email->message($message);
		$this->email->send();

		echo $this->email->print_debugger();
	}

	
}